package org.coding.springbootdemorabbitmqconsumer.consumer;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Component;

/**
 * ^ enjoy coding and be bugfree boy
 *
 * @author guoxh
 * @date 2020/11/13 10:39 下午
 * @desc
 **/
@Component
@RabbitListener(
        bindings = @QueueBinding(
                value = @Queue(value = "${mq.config.queue.info}",autoDelete = "true"),
                exchange = @Exchange(value = "${mq.config.exchange}",type = ExchangeTypes.DIRECT),
                key = "${mq.config.queue.info.routingkey}"

        )
)
public class InfoConsumer {

        @RabbitHandler
        public void process(String msg){
                System.out.println("info receiver:"+ msg);
        }
}
